Ext.define('ECAT.lib.Function', {
	getXiaoImgSrc : function(img_name){
		return "resources/images/xiao/"+ img_name + ".jpg";
	},
	getDaImgSrc : function(img_name){
		return "resources/images/da/"+ img_name + ".jpg";
	},
	getIconSrc : function(icon_name){
		return "resources/images/icons/"+ icon_name + ".png";
	},
	getIconFileSrc : function(fileName){
		return "resources/images/icons/"+ fileName;
	},
	showImageDetail: function(img, panel, list, backText, callback, callbackArgs){
    	var record = img.config.record,
    		store = Ext.getStore(list.getConfig('store')),
    		currentIndex = store.find('name', record.get('name'));
    	// 这是标题栏
    	var topbar = Ext.getCmp('topbar');
		topbar.toImageDetailView(backText, panel, callback, callbackArgs);
    		
    	var imageDetailView = Ext.getCmp('imagedetailview');
    	if(!imageDetailView){
    		imageDetailView = Ext.create('ECAT.view.ImageDetailView',{});
    	}
    	imageDetailView.setCurrentImageSrc(store, currentIndex);
    	
		
    	// 隐藏菜单
    	Ext.getCmp('btn_menu_down').fireEvent('tap');
    	Ext.Viewport.animateActiveItem(
	        imageDetailView,  
			{  
			    type: 'slide',  
			    direction: 'left'  
			}
	    ); 
    }
});